<template>
  <div class="container">
    <div>
     
      <h1 class="title" @click="route">
          {{ $t('home.title')+11 }}
      </h1>
      <h2 class="subtitle">
        <nuxt-link to="/abouy">
         {{ $t('home.title')+11 }}
        </nuxt-link>
      </h2>
      <div class="links">
        <a href="https://nuxtjs.org/" target="_blank" class="button--green">Documentation</a>
        <a href="https://github.com/nuxt/nuxt.js" target="_blank" class="button--grey">GitHub</a>
      </div>
    </div>
  </div>
</template>

<script>
import Cookies from "js-cookie";
import Logo from "~/components/Logo.vue";
import { signin, menu1 } from "../../axios/Api.js";
import { mapState, mapMutations, mapActions, mapGetters } from "vuex";
export default {
  middleware: "authenticated",
  data() {
    return {
      list1: 0,
      list: 0,
      token: 100
    };
  },
  components: {
    Logo
  },
  computed: {
    ...mapState("geo", ["position"])
  },
  async asyncData(ctx) {
    // console.log(ctx.store.state.geo.auth);
    // const menu = await signin(ctx.app);
    // const menu2 = await menu1(ctx.app);
    return {
      list: ctx.store.state.geo.auth
    };
  },
  async created() {
    // console.log(this.$store.state.geo.auth)

    // this.$axios.defaults.headers.auth = this.$store.state.geo.auth;

    // const menu = await signin(this);
    // const menu2 = await menu1(this);

    // console.log(menu)
    // console.log(menu2)
    //  console.log(process.env.NODE_ENV)
  },
  mounted() {
    // console.log(this.$axios.defaults.headers);
    this.setPosition();
    this.setPositionmun();
  },
  methods: {
    route() {
    
      this.$router.push(   this.$i18n.path("about"))
    },
    ...mapMutations("geo", ["setPositionmun"]),
    ...mapActions("geo", ["setPosition"])
  }
};
</script>

<style>

</style>
